/**
 * Created by Asura on 2015/11/18.
 */
var http = require("http");
var url = require("url");

function start(route, handle) {
    http.createServer(function (request, response) {
        var pathname = url.parse(request.url).pathname;
        console.log("Request for " + pathname + " received.");
        route(handle, pathname, response, request);
    }).listen(3000);
    console.log("Server has started.");
}

exports.start = start;
